//	--------------------------------------------------------------------
//	Copyright(C) 2006,2007 Zhao Yukun. All rights reserved.
//	This file is a part of the Xeres system.
//	Xeres 2007
//	Contact : xeres.engine@gmail.com
//	$(reservedInfo)
//	$(reservedDeclaration)
//	--------------------------------------------------------------------
///	@file	<IGeometry.cpp>
///	@path	~/src/graphics/
///	@date	2007/10/11
///	@desc	Geometry interface.

#include "config/config.h"
#include "config/os.h"

#include "lib/utilities/dict.h"

#include "graphics/IGeometry.h"

namespace xeres {

	IMPL_IOBJECT_INTERFACE( IGeometry );

	// ctor
	IGeometry::IGeometry( void )
	{
	}

	// dtor
	IGeometry::~IGeometry( void )
	{
	}

	// WhichTopologyType
	TopologyType IGeometry::WhichTopologyType( const WString& type )
	{
		static dict<WString , TopologyType> s_topoType;
		if( s_topoType.size() == 0 )
		{
			for( int a = TOPOLOGY_POINTS ; a < TOPOLOGY_last ; ++a )
			{
				s_topoType[ TopologyTypeNames[a] ] = (TopologyType)a;
			}
		}

		if( !s_topoType.has_key( type ) )
		{
			return TOPOLOGY_last;
		}

		return s_topoType.find( type )->second;
	}

} // namespace xeres
